Skip to content

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Oct 29, 2025

Description

  • Added Eslint Configuration
  • Updated eslint errors

Type of Change

  • Feature (non-breaking change which adds functionality)

Summary by CodeRabbit

  • New Features

    • Introduced unified PlaneClient entry point for simplified SDK initialization and resource access.
    • Added improved error handling with dedicated error types for better debugging.
    • Implemented centralized configuration management for API credentials and settings.
  • Documentation

    • Added comprehensive SDK architecture guide and development standards.
    • Added example bootstrap script demonstrating SDK usage.
    • Updated README with migration guide and setup instructions.
  • Build & Configuration

    • Added GitHub Actions workflow for continuous build and testing.
    • Added ESLint and Prettier configurations for code quality.
    • Updated package configuration to Node.js v20+ and modernized tooling.

@sriramveeraghanta sriramveeraghanta marked this pull request as ready for review October 29, 2025 12:50
@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Code Review Analysis

Walkthrough

This PR transitions the Plane Node SDK from auto-generated OpenAPI clients to a handcrafted architecture. It removes all generated APIs and models, introduces Configuration and BaseResource foundation classes, implements organized API resource classes for each domain, adds OAuth client support, and includes updated build tooling and comprehensive documentation.

Changes

Cohort / File(s) Summary
Configuration & Initialization
src/Configuration.ts
New Configuration class storing baseUrl, apiKey, accessToken, enableLogging with constructor and validate() method for SDK initialization.
Base HTTP Infrastructure
src/api/BaseResource.ts
Abstract base class encapsulating HTTP methods (get, post, put, patch, httpDelete), header assembly, URL construction, error handling, and request/response logging with data sanitization.
API Resources: Work Items
src/api/WorkItems/index.ts, src/api/WorkItems/Activities.ts, src/api/WorkItems/Attachments.ts, src/api/WorkItems/Comments.ts, src/api/WorkItems/Relations.ts, src/api/WorkItems/WorkLogs.ts
Full CRUD and auxiliary operations for work items and related sub-resources (activities, attachments, comments, relations, work logs).
API Resources: Cycles & Modules
src/api/Cycles.ts, src/api/Modules.ts
Cycle and module management including archiving, work item association, and listing operations.
API Resources: Projects, States, Labels
src/api/Projects.ts, src/api/States.ts, src/api/Labels.ts
Project, state, and label CRUD operations with listing and optional filtering.
API Resources: Other Domains
src/api/Epics.ts, src/api/Intake.ts, src/api/Pages.ts, src/api/Links.ts, src/api/Members.ts, src/api/Users.ts, src/api/Workspace.ts
Specialized resources for epics, intake, pages, links, members, users, and workspace operations.
API Resources: Work Item Properties & Customers
src/api/WorkItemProperties/index.ts, src/api/WorkItemProperties/Options.ts, src/api/WorkItemProperties/Values.ts, src/api/Customers/index.ts, src/api/Customers/Properties.ts, src/api/Customers/Requests.ts
Complex nested resources for work item properties and customer management.
Client Facade
src/client/plane-client.ts, src/client/oauth-client.ts, src/client/index.ts
PlaneClient aggregating all resources, OAuthClient for token exchange, and re-export barrel.
Error Handling
src/errors/PlaneError.ts, src/errors/HttpError.ts, src/errors/index.ts
Custom error classes extending Error with statusCode and response fields.
Data Models
src/models/Attachment.ts, src/models/Comment.ts, src/models/Customer.ts, src/models/Cycle.ts, src/models/Epic.ts, src/models/Intake.ts
Type definitions for API request/response payloads and domain entities.
Public API Exports
src/index.ts
Consolidated re-export barrel replacing legacy generated exports with new SDK surface.
Build & Tooling
.github/workflows/build-test.yaml, eslint.config.mjs, .prettierrc, .prettierignore, package.json
GitHub Actions CI/CD, ESLint v9 config with unused-imports plugin, Prettier config, and updated dependencies (axios, ts-jest, Jest 29, TypeScript 5, Node >=20).
Project Configuration
.gitignore, .npmignore, env.example
Ignore patterns for generated/environment files, npm publishing, and test environment template.
Documentation
README.md, AGENTS.MD, examples/README.md, examples/bootstrap-project.ts, LICENSE
Comprehensive SDK docs, architecture blueprint, bootstrapping example, and MIT license.
Deleted: Generated OpenAPI
src/apis/*, src/models/* (legacy), .openapi-generator*
Entire auto-generated API client surface (AssetsApi, CyclesApi, EpicsApi, IntakeApi, LabelsApi, MembersApi, ModulesApi, PagesApi, ProjectsApi, StatesApi, UsersApi, WorkItemActivityApi, WorkItemAttachmentsApi, WorkItemCommentsApi, WorkItemLinksApi, WorkItemPropertiesApi, WorkItemTypesApi, WorkItemWorklogsApi, WorkItemsApi, WorkspacesApi) and associated models removed.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PlaneClient
    participant Resource as API Resource<br/>(extends BaseResource)
    participant Axios
    participant API as Plane API

    User->>PlaneClient: new PlaneClient(config)
    activate PlaneClient
    PlaneClient->>PlaneClient: Create Configuration
    PlaneClient->>PlaneClient: Initialize all Resources
    PlaneClient-->>User: Ready
    deactivate PlaneClient

    User->>PlaneClient: client.projects.list()
    activate PlaneClient
    PlaneClient->>Resource: list(workspaceSlug)
    activate Resource
    Resource->>Resource: buildUrl(endpoint)
    Resource->>Resource: getHeaders() with auth
    Note over Resource: Intercept request/response if enableLogging
    Resource->>Axios: get(url, {headers, params})
    activate Axios
    Axios->>API: GET /api/v1/workspaces/{...}/projects/
    activate API
    API-->>Axios: 200 { projects: [...] }
    deactivate API
    Axios-->>Resource: response
    deactivate Axios
    Note over Resource: Log if enableLogging enabled
    Resource->>Resource: handleError (if error)
    Resource-->>PlaneClient: PaginatedResponse<Project>
    deactivate Resource
    PlaneClient-->>User: result
    deactivate PlaneClient

    rect rgba(100, 200, 100, 0.3)
        Note over Resource,Axios: New Architecture<br/>- Custom BaseResource<br/>- Axios for HTTP<br/>- Centralized auth/logging<br/>- Error translation to HttpError
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Specific areas requiring extra attention:

  • BaseResource HTTP implementation (src/api/BaseResource.ts): Verify error handling, authentication header assembly, interceptor logic, and sanitization of sensitive data in logs.
  • Configuration validation (src/Configuration.ts): Ensure apiKey/accessToken validation logic is correct and covers all required scenarios.
  • PlaneClient initialization (src/client/plane-client.ts): Confirm all API resources are correctly instantiated and accessible through the facade.
  • OAuth client rewrite (src/client/oauth-client.ts): Review token exchange flow, Basic auth encoding, and error handling—significant shift from runtime.BaseAPI to Axios.
  • API resource methods consistency: Verify URL construction patterns, parameter handling, and return types are consistent across all resource classes (Projects, WorkItems, Cycles, etc.).
  • Model definitions: Check that new simplified models (src/models/Cycle.ts, src/models/Epic.ts, etc.) correctly replace removed generated models and that imports/dependencies are resolved.
  • Package.json changes: Validate new dependencies (axios, ts-jest), engine requirements (Node >=20), and script definitions align with CI/CD workflow.
  • GitHub Actions workflow: Ensure build, lint, format, and test steps execute in correct sequence and that all linting/formatting tools are properly configured.

Possibly related PRs

  • feat: publish sdk 0.1.5 with below changes #4: Parallel PR touching similar API surfaces (Epics, Pages, Workspaces) and models (AccessBd4Enum); establishes context for generated API deprecation and custom resource architecture.

Suggested reviewers

  • Saurabhkmr98

Poem

🐰 From generated code's cascade, a clean SDK does rise,
BaseResource holds the secrets, Axios powers the skies,
PlaneClient greets all resources with open arms so wide,
TypeScript types keep us honest, with Config as our guide,
Handcrafted paths replace the noise—a maintainer's delight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title "fix: eslint" is misleading and does not accurately represent the primary changes in this PR. While the raw summary does show an update to eslint.config.mjs (replacing imports and adding the unused-imports plugin), this is a minor configuration change relative to the overall scope of work. The actual main changes constitute a complete architectural restructuring of the SDK: transitioning from OpenAPI-generated code (with numerous auto-generated src/apis/* files) to a custom-built implementation with new core classes like PlaneClient, Configuration, and BaseResource, plus a complete rewrite of models and documentation. The title's focus on ESLint suggests this PR addresses only linting configuration, which would not prepare a teammate reviewing the commit history to understand the significance of this major SDK redesign. The title should be revised to reflect the primary purpose of the changeset. Consider a more descriptive title such as "Restructure SDK from OpenAPI-generated to custom implementation" or "Implement new PlaneClient architecture with custom resource classes" to clearly communicate that this is a major SDK redesign rather than a routine ESLint configuration fix.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Prashant-Surya Prashant-Surya changed the base branch from main to v0.2.x October 29, 2025 12:58
@Prashant-Surya Prashant-Surya merged commit ea571de into v0.2.x Oct 29, 2025
1 check passed
@Prashant-Surya Prashant-Surya deleted the fix-eslint branch October 29, 2025 13:44
sriramveeraghanta added a commit that referenced this pull request Oct 29, 2025
* delete old sdk code

* [SILO-589] feat!: add handcrafted SDK v0.2.0 #8

* fix: prettier configuration (#10)

* feat!: add handcrafted SDK v0.2.0

- added models for each entities
- added APIs for all available Plane entities
- tests to verify e2e api sanity
- examples for reference

BREAKING CHANGE: must be carefully upgraded from 0.1.x versions as method signatures
are changed

* chore: adding prettier config

* chore: remove ds store

* fix: format all files

* chore: package imports

---------

Co-authored-by: Surya Prashanth <[email protected]>

* feat: add e2e and unit tests (#11)

* move existing tests under unit folder

* don't fail unit tests when env is not setup

* create helpers folder for test helpers

* feat: add e2e test to verify project use case

* add jest and tsconfig.jest files

* feat: add unit tests using jest for all entities

* fix: eslint (#12)

* chore: eslint config setup

* chore: updated the build test workflow

* chore: setup pnpm workflow

* chore: build errors

* chore: updated the push step

* ops: update publishing flow for new sdk (#13)

* ops: update publishing flow for nw sdk

* run only e2e tests in github actions

* chore: updated the publish workflow with corepack changes

* chore: remove unused imports

---------

Co-authored-by: Surya Prashanth <[email protected]>
@coderabbitai coderabbitai bot mentioned this pull request Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants